# Open a PoSh prompt in this dir and execute this script to try to get the needed Tfs binaries
# The script requires that you have Tfs installed
# Make sure that powershell.exe.config looks something like this
# <?xml version="1.0"?>
# <configuration>
# 	<startup useLegacyV2RuntimeActivationPolicy="true">
# 		<supportedRuntime version="v4.0.30319"/>
# 		<supportedRuntime version="v2.0.50727"/>
# 	</startup>
# </configuration> 
$localKey = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::LocalMachine, [Microsoft.Win32.RegistryView]::Registry64)
$localKey = $localKey.OpenSubKey("Software\Microsoft\TeamFoundationServer\10.0\InstalledComponents\ApplicationTier");
$tfsInstallPath = $localKey.GetValue("InstallPath").ToString()

copy "$tfsInstallPath\Web Services\bin\Microsoft.TeamFoundation.WorkItemTracking.Server.Dataaccesslayer.dll" .
copy "$tfsInstallPath\Web Services\bin\Microsoft.TeamFoundation.Server.dll" .
copy "$tfsInstallPath\Web Services\bin\Microsoft.TeamFoundation.Framework.Server.dll" .
copy "$tfsInstallPath\TFSJobAgent\Microsoft.TeamFoundation.Admin.dll" .
copy "$tfsInstallPath\TFSJobAgent\Microsoft.TeamFoundation.Admin.Common.dll" .

